<template>
	<view class="pr">
		<view class="nav"></view>
		<view class="pa0 w100">
			<view class="m2432">
				<view class="tc cf fw600 fs28">账户余额</view>
				<view class="tc mt14 cf fw500">
					<text class="fs40">￥</text>
					<text class="fs64">{{user.money}}</text>
				</view>

				<view class="mt24 pt24 pb30 bgf menu br12 flex_ard">
					<view class="flex_col flex_c" @click="toPath(1)">
						<image class="img60" src="/static/index/serve/tx.png" mode=""></image>
						<view class="mt4 c3 fs24">申请提现</view>
					</view>
					<view class="flex_col flex_c" @click="toPath(2)">
						<image class="img60" src="/static/index/serve/mx.png" mode=""></image>
						<view class="mt4 c3 fs24">余额明细</view>
					</view>
				</view>

				<view class="mt24 p24 bgf br12">
					<view class="">
						<view class="flex_x">
							<image class="img120" src="/static/index/serve/je.png" mode=""></image>
							<view class="flex1 ml34">
								<view class="fw500 c2a7 fs44">
									<text class="fs36">￥</text>
									<text>{{shop_num.money_revenue}}</text>
								</view>
								<view class="mt14 c3 fw500 fs28">今日预计收入</view>
							</view>
						</view>
					</view>
				</view>

				<view class="mt24 p24 bgf br12">
					<view class="" v-for="item in balance_details">
						<view class="flex_btw">
							<view class="">
								<image class="img60" src="/static/index/serve/qian.png" mode=""></image>
							</view>
							<view class="flex1 mlr20">
								<view class="c3 fw500 fs24">共100单</view>
								<view class="c9 fs24 mt4">2021-11-24</view>
							</view>
							<view class="">
								<view class="c2a7 fs24 fw500">￥407.56</view>
		<!-- 						<view class="mt4 fs24 fw500 tc">
									<text class="cf0" v-if="item>1">未入账</text>
									<text class="c3" v-else>已入账</text>
								</view> -->
							</view>
						</view>
						<view class="mtb24">
							<view class="cut_line ml80"></view>
						</view>
					</view>
					<view class="cfe4 fs24 fw500 tc" @click="toPath(3)">查看全部收款</view>
				</view>

				<view class="mt24 c2a7 fs26 fw500">
					注意：由于订单异常或跨天结算等原因，结算中与实际入账金额可能会有误差，请以实际入账金额为准。
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				shop_num: '', //今日收入
				balance_details:[],//余额
			}
		},
		onLoad() {
			this.statistics()
		},
		onShow() {

		},
		methods: {
			statistics() { //服务点数据统计
				this.$api.statistics().then(res => {
					if (res.code == 1) {
						this.shop_num = res.data
						this.commission_income()
					}
				})
			},
			commission_income(){ //余额明细
				this.$api.commission_income({
					type:2,
					status:1
				}).then(res=>{
					if(res.code == 1){
						this.balance_details = res.data.data.slice(0,4)
					}
				})
			},
			toPath(e) {
				if (e == 1) {
					uni.navigateTo({ //申请提现
						url: '/pages/server/index/finance/withdraw/withdraw'
					})
				} else if (e == 2) { //余额明细
					uni.navigateTo({
						url: '/pages/server/index/finance/balanceDetails/balanceDetails'
					})
				} else if (e == 3) { //查看全部收款
					uni.navigateTo({
						url: '/pages/server/index/finance/proceedsAll/proceedsAll'
					})
				}
			},

		},
		computed: {

		},
		watch: {

		}
	}
</script>

<style lang="scss" scoped>
	.nav {
		height: 315upx;
		background-color: #2479D8;
		border-radius: 0 0 540rpx 540rpx/0 0 80rpx 80rpx;
	}

	.menu {
		box-shadow: 0px 3upx 6upx 0px rgba(14, 14, 14, 0.15);
	}
</style>
